const std = @import("std");
const assert = std.debug.assert;

pub fn ArrayComponentStorage(comptime C: type, comptime N: usize) type {
    return struct {
        const Self = @This();
        const C = C;
        const N = N;
        
        components: [N]C,

        pub fn init() Self {
            return Self {
                .components = undefined,
            };
        }

        pub fn get(self: Self, index: usize) C {
            assert(index < N);

            return self.components[index];
        }

        pub fn set(self: *Self, index: usize, value: C) void {
            assert(index < N);
            
            self.components[index] = value;
        }
    };
}